package com.utcs.modules.resource.basic.controller;

import com.utcs.modules.resource.basic.service.DepartmentService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by Fly on 2017/5/23.
 * 部门Controller
 */
@Controller
@RequestMapping("resource/basic/department/")
public class DepartmentController {

    @Autowired
    DepartmentService departmentService;

    @RequiresPermissions("basic:department:view")
    @RequestMapping(value = "/list")
    public String list(Model model){
        model.addAttribute("list",departmentService.findAll());
        return "modules/resource/basic/department";
    }
}
